<?php

/**
 * Comentario form base class.
 *
 * @package    form
 * @subpackage comentario
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseComentarioForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_comentario'   => new sfWidgetFormInputHidden(),
      'descricao'       => new sfWidgetFormInput(),
      'data_comentario' => new sfWidgetFormDateTime(),
      'status'          => new sfWidgetFormInput(),
      'id_midia'        => new sfWidgetFormDoctrineChoice(array('model' => 'Midia', 'add_empty' => true)),
      'id_evento'       => new sfWidgetFormDoctrineChoice(array('model' => 'Evento', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id_comentario'   => new sfValidatorDoctrineChoice(array('model' => 'Comentario', 'column' => 'id_comentario', 'required' => false)),
      'descricao'       => new sfValidatorString(array('max_length' => 255)),
      'data_comentario' => new sfValidatorDateTime(array('required' => false)),
      'status'          => new sfValidatorInteger(),
      'id_midia'        => new sfValidatorDoctrineChoice(array('model' => 'Midia', 'required' => false)),
      'id_evento'       => new sfValidatorDoctrineChoice(array('model' => 'Evento', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('comentario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Comentario';
  }

}
